"use strict";

const Controller = require("egg").Controller;

class InfoControllerController extends Controller {
    /**
     *
     * @param {Egg.Context} ctx egg - context
     */
    constructor(ctx) {
        super(ctx);
        this.auth = this.ctx.locals.auth;
    }

    /**
     * @api {get} /x/v1/user/fullInfo 获取用户信息
     * @apiName 获取用户信息
     * @apiGroup 用户
     * @apiVersion 1.0.0
     *
     * @apiUse Login
     *
     */
    async fullInfo() {
        const { uid } = this.auth;

        this.auth.isLogin();

        const user = await this.ctx.model.Users.findByPk(uid);
        this.ctx.returnBody(200, "ok", user);
    }
}

module.exports = InfoControllerController;
